Flattens a 2D array into a new collection. The items are copied row by row.
Example usage:
int[][] array = [[0, 1], [2, 3]] assert array.flatten() == [0, 1, 2, 3]
A transpose method for 2D int arrays.
Example usage:
int[][] nums = [[10, 15, 20], [30, 35, 40]] int[][] expected = [[10, 30], [15, 35], [20, 40]] assert nums.transpose() == expected